import cv2 as cv
import numpy as np

img = cv.imread('../resources/miku.jpg')
h, w, c = img.shape

blank = np.zeros((h, w, c), dtype='uint8')
blank[:,:] = (2, 2, 2)

cv.imshow('img', img)
# cv.imshow('blank', cv.add(img, blank)) # 通过add提高亮度
# cv.imshow('blank', cv.subtract(img, blank)) # 通过subtract减少亮度
cv.imshow('blank', cv.divide(img, blank)) # 通过divide降低对比度
# cv.multiply(img, blank) # 通过multiply提高对比度

cv.waitKey(0)
cv.destroyAllWindows()